package yunplus.io.hchome.utils;

import android.text.TextUtils;

import yunplus.io.hchome.utils.codec.AESUtil;

/**
 * Created by WangFan on 2017/3/16.
 */

public class PasswordEncoder {

    public final static String encodePass(String pass){
        if(TextUtils.isEmpty(pass)){
            return "11111111111111111111111111111111";
        }
        String _pass = pass;
        int len = pass.length();
        if(len<16){
            //使用len补位
            for(int i = len; i< 16; i++){
                _pass = _pass + len;
            }
        }
        try {
            return new AESUtil("helloaeshelloaes").encryptData(_pass);
        } catch (Exception e) {
            return "11111111111111111111111111111111";
        }
    }
}
